package com.example.vbloodbanksalesforce;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class HomePage  extends BaseActivity {
	
	private String list[]={"DonorEntryForm","BloodDetails","DonorsLocations"};
	ListView lv;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.homepage);
		
		lv = (ListView) findViewById(R.id.list);
		
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,list);
		lv.setAdapter(adapter);
		
		lv.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View v, int position,
					long arg3) {
				
				if(position == 0){
					startActivity(new Intent(getApplicationContext(),DonorRegistration.class));					
				}
				if(position == 1){
					startActivity(new Intent(getApplicationContext(),DonorDetails.class));					
				}
				if(position == 2){
					startActivity(new Intent(getApplicationContext(),DonorsLocations.class));					
				}
			}
		});
	}

}
